package interfaces;

import java.io.IOException;
import java.rmi.Remote;
import java.rmi.RemoteException;

import valueObjects.game.Player;
import valueObjects.game.card.Card;
import valueObjects.game.card.door.CharacterClassCard;
import valueObjects.game.card.door.CharacterRaceCard;
import valueObjects.game.card.door.MonsterCard;
import valueObjects.game.card.treasure.EquipmentCard;
import valueObjects.game.card.treasure.MiscellaneousCard;
import exception.equipment.NotEquipable;

/**
 * Sending orders to the server.
 * @author Marius
 */
public interface IClientSender extends Remote {

	/**
	 * Sender for cards
	 * @param c
	 * @throws RemoteException
	 */
	public void sendCard(Card c) throws RemoteException;
	/**
	 * Sender for starting the Game
	 * @throws RemoteException
	 */
	public void sendStartGame() throws RemoteException;
	
	/**
	 * Sender for Chatmessages
	 * @param nick
	 * @param message
	 * @throws RemoteException
	 */
	public void sendMessage(String message) throws RemoteException;
	
	/**
	 * Sender for Checking if the deliverd Player won
	 * @throws RemoteException
	 * @throws IOException 
	 */
	public void finish() throws RemoteException, IOException;
	/**
	 * Sender adding the Miscellaneous cards
	 * @param player
	 * @param card
	 * @throws RemoteException
	 * @throws NotEquipable
	 */
	public void addMiscellaneuos(MiscellaneousCard card) throws RemoteException, NotEquipable;

	/** Sender  for  changing Equipment
	 * @param player
	 * @param slot
	 * @param equipmentCard
	 * @throws RemoteException
	 * @throws NotEquipable
	 */
	public void changeEquipment(String slot, EquipmentCard equipmentCard) throws RemoteException, NotEquipable;

	/**
	 * Sender for getPlayer
	 * @throws RemoteException
	 */
	public Player getPlayer() throws RemoteException;
	/**
	 * Sender for initiate a combat
	 * @param currentPlayer
	 * @param monsterCard
	 * @throws RemoteException
	 * @throws InterruptedException 
	 */
	public boolean combat(MonsterCard monsterCard) throws RemoteException, InterruptedException;

	/**
	 * Sender for askForInteraction
	 * @param player
	 * @throws RemoteException
	 * @throws InterruptedException 
	 */
	public boolean askForInteraction() throws RemoteException, InterruptedException;
	/**
	 * Sender for askForInteraction
	 * @param player
	 * @throws RemoteException
	 * @throws InterruptedException 
	 */
	public boolean askForHelp() throws RemoteException, InterruptedException;
	
	/**
	 * Sender for flee
	 * @param c
	 * @throws RemoteException 
	 */
	public void flee(MonsterCard c) throws RemoteException;
	
	/**
	 * Adds a card to the player
	 * @param c
	 * @throws RemoteException
	 */
	public void addCard(Card c) throws RemoteException;
	
	/**
	 * Removes a card from the players hand
	 * @param card
	 * @throws RemoteException
	 */
	public void removeCard(Card card) throws RemoteException;
	
	/**
	 * Adds a card for acting against a player
	 * @param mCard
	 * @throws RemoteException
	 */
	public void addCardInteractAgainst(MonsterCard mCard) throws RemoteException;
	
	/**
	 * Sets the characterracecard for the player
	 * @param equipmentCard
	 * @throws RemoteException
	 */
	public void setCharacterRace(CharacterRaceCard equipmentCard) throws RemoteException;
	
	/**
	 * Sets the characterclasscard for the player
	 * @param equipmentCard
	 * @throws RemoteException
	 */
	public void setCharacterClass(CharacterClassCard equipmentCard) throws RemoteException;
	
	/**
	 * Asks other if they want to save the game
	 * @return
	 * @throws RemoteException 
	 */
	public boolean askForSave() throws RemoteException;
	
	/**
	 * Prepares the player
	 * @param server 
	 * @param gui 
	 */
	public void prepare(IGameManagement server) throws RemoteException;
	
	/**
	 * Sends waiting for card
	 * @throws RemoteException
	 */
	public void sendWaitForCard() throws RemoteException;
	
}
